﻿namespace BloggerBackup
{
    using BloggerBackup.My.Resources;
    using Microsoft.VisualBasic.CompilerServices;
    using PAB.Security;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Options : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("Cancel_Button")]
        private Button _Cancel_Button;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("OK_Button")]
        private Button _OK_Button;
        [AccessedThroughProperty("ProxyPasswordTextBox")]
        private TextBox _ProxyPasswordTextBox;
        [AccessedThroughProperty("ProxyPortTextBox")]
        private MaskedTextBox _ProxyPortTextBox;
        [AccessedThroughProperty("ProxyURLTextBox")]
        private TextBox _ProxyURLTextBox;
        [AccessedThroughProperty("ProxyUserIdTextBox")]
        private TextBox _ProxyUserIdTextBox;
        private BloggerBackupSettings _Settings;
        [AccessedThroughProperty("TableLayoutPanel1")]
        private TableLayoutPanel _TableLayoutPanel1;
        [AccessedThroughProperty("UseWebProxyCheckBox")]
        private CheckBox _UseWebProxyCheckBox;
        private IContainer components;

        [DebuggerNonUserCode]
        public Options()
        {
            base.Load += new EventHandler(this.Options_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.InitializeComponent();
        }

        private void Cancel_Button_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (((disposing && (this.components != null)) ? 1 : 0) != 0)
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.TableLayoutPanel1 = new TableLayoutPanel();
            this.OK_Button = new Button();
            this.Cancel_Button = new Button();
            this.GroupBox1 = new GroupBox();
            this.UseWebProxyCheckBox = new CheckBox();
            this.ProxyPortTextBox = new MaskedTextBox();
            this.Label4 = new Label();
            this.Label3 = new Label();
            this.Label2 = new Label();
            this.ProxyUserIdTextBox = new TextBox();
            this.ProxyPasswordTextBox = new TextBox();
            this.ProxyURLTextBox = new TextBox();
            this.Label1 = new Label();
            this.TableLayoutPanel1.SuspendLayout();
            this.GroupBox1.SuspendLayout();
            this.SuspendLayout();
            this.TableLayoutPanel1.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.TableLayoutPanel1.ColumnCount = 2;
            this.TableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f));
            this.TableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f));
            this.TableLayoutPanel1.Controls.Add(this.OK_Button, 0, 0);
            this.TableLayoutPanel1.Controls.Add(this.Cancel_Button, 1, 0);
            Point point = new Point(0xe7, 0x8d);
            this.TableLayoutPanel1.Location = point;
            this.TableLayoutPanel1.Name = "TableLayoutPanel1";
            this.TableLayoutPanel1.RowCount = 1;
            this.TableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 50f));
            Size size = new Size(0x92, 0x1d);
            this.TableLayoutPanel1.Size = size;
            this.TableLayoutPanel1.TabIndex = 0;
            this.OK_Button.Anchor = AnchorStyles.None;
            point = new Point(3, 3);
            this.OK_Button.Location = point;
            this.OK_Button.Name = "OK_Button";
            size = new Size(0x43, 0x17);
            this.OK_Button.Size = size;
            this.OK_Button.TabIndex = 0;
            this.OK_Button.Text = "OK";
            this.Cancel_Button.Anchor = AnchorStyles.None;
            this.Cancel_Button.DialogResult = DialogResult.Cancel;
            point = new Point(0x4c, 3);
            this.Cancel_Button.Location = point;
            this.Cancel_Button.Name = "Cancel_Button";
            size = new Size(0x43, 0x17);
            this.Cancel_Button.Size = size;
            this.Cancel_Button.TabIndex = 1;
            this.Cancel_Button.Text = "Cancel";
            this.GroupBox1.Controls.Add(this.UseWebProxyCheckBox);
            this.GroupBox1.Controls.Add(this.ProxyPortTextBox);
            this.GroupBox1.Controls.Add(this.Label4);
            this.GroupBox1.Controls.Add(this.Label3);
            this.GroupBox1.Controls.Add(this.Label2);
            this.GroupBox1.Controls.Add(this.ProxyUserIdTextBox);
            this.GroupBox1.Controls.Add(this.ProxyPasswordTextBox);
            this.GroupBox1.Controls.Add(this.ProxyURLTextBox);
            this.GroupBox1.Controls.Add(this.Label1);
            point = new Point(12, 12);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            size = new Size(0x170, 0x7c);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 0;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "Web Proxy Configuration";
            this.UseWebProxyCheckBox.AutoSize = true;
            point = new Point(9, 0x13);
            this.UseWebProxyCheckBox.Location = point;
            this.UseWebProxyCheckBox.Name = "UseWebProxyCheckBox";
            size = new Size(0x6a, 0x11);
            this.UseWebProxyCheckBox.Size = size;
            this.UseWebProxyCheckBox.TabIndex = 0;
            this.UseWebProxyCheckBox.Text = "Use Web Proxy?";
            this.UseWebProxyCheckBox.UseVisualStyleBackColor = true;
            this.ProxyPortTextBox.AsciiOnly = true;
            this.ProxyPortTextBox.Enabled = false;
            this.ProxyPortTextBox.HidePromptOnLeave = true;
            point = new Point(0x13c, 0x37);
            this.ProxyPortTextBox.Location = point;
            this.ProxyPortTextBox.Mask = "######";
            this.ProxyPortTextBox.Name = "ProxyPortTextBox";
            size = new Size(0x2b, 20);
            this.ProxyPortTextBox.Size = size;
            this.ProxyPortTextBox.TabIndex = 4;
            this.Label4.AutoSize = true;
            point = new Point(0xb8, 0x4e);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x38, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 7;
            this.Label4.Text = "Password:";
            this.Label3.AutoSize = true;
            point = new Point(6, 0x4e);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x2c, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 5;
            this.Label3.Text = "User Id:";
            this.Label2.AutoSize = true;
            point = new Point(0x139, 0x27);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x1d, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 3;
            this.Label2.Text = "Port:";
            this.ProxyUserIdTextBox.Enabled = false;
            point = new Point(9, 0x5e);
            this.ProxyUserIdTextBox.Location = point;
            this.ProxyUserIdTextBox.Name = "ProxyUserIdTextBox";
            size = new Size(0xac, 20);
            this.ProxyUserIdTextBox.Size = size;
            this.ProxyUserIdTextBox.TabIndex = 6;
            this.ProxyPasswordTextBox.Enabled = false;
            point = new Point(0xbb, 0x5e);
            this.ProxyPasswordTextBox.Location = point;
            this.ProxyPasswordTextBox.Name = "ProxyPasswordTextBox";
            size = new Size(0xac, 20);
            this.ProxyPasswordTextBox.Size = size;
            this.ProxyPasswordTextBox.TabIndex = 8;
            this.ProxyPasswordTextBox.UseSystemPasswordChar = true;
            this.ProxyURLTextBox.Enabled = false;
            point = new Point(9, 0x37);
            this.ProxyURLTextBox.Location = point;
            this.ProxyURLTextBox.Name = "ProxyURLTextBox";
            size = new Size(0x126, 20);
            this.ProxyURLTextBox.Size = size;
            this.ProxyURLTextBox.TabIndex = 2;
            this.Label1.AutoSize = true;
            point = new Point(6, 0x27);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x9e, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 1;
            this.Label1.Text = "Proxy URL (http://192.168.0.1):";
            this.AcceptButton = this.OK_Button;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.CancelButton = this.Cancel_Button;
            size = new Size(0x185, 0xb6);
            this.ClientSize = size;
            this.Controls.Add(this.GroupBox1);
            this.Controls.Add(this.TableLayoutPanel1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Options";
            this.ShowInTaskbar = false;
            this.StartPosition = FormStartPosition.CenterParent;
            this.Text = "Options";
            this.TableLayoutPanel1.ResumeLayout(false);
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            this.ResumeLayout(false);
        }

        private void OK_Button_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void Options_Load(object sender, EventArgs e)
        {
        }

        public DialogResult ShowDialog(IWin32Window owner, BloggerBackupSettings settings)
        {
            DialogResult result;
            this._Settings = settings;
            this.UseWebProxyCheckBox.Checked = this._Settings.ProxyEnabled;
            if (this.UseWebProxyCheckBox.Checked)
            {
            }
            this.ProxyURLTextBox.Text = this._Settings.ProxyURL;
            if (this._Settings.ProxyPort > 0)
            {
                this.ProxyPortTextBox.Text = Conversions.ToString(this._Settings.ProxyPort);
            }
            this.ProxyUserIdTextBox.Text = this._Settings.ProxyUserId;
            this.ProxyPasswordTextBox.Text = DPAPI.UnProtectData(this._Settings.ProxyPassword, BloggerBackup.My.Resources.Resources.BlogURL);
            if (base.ShowDialog(owner) == DialogResult.OK)
            {
                this._Settings.ProxyEnabled = this.UseWebProxyCheckBox.Checked;
                this._Settings.ProxyURL = this.ProxyURLTextBox.Text;
                BloggerBackupSettings settings2 = this._Settings;
                int proxyPort = settings2.ProxyPort;
                settings2.ProxyPort = proxyPort;
                if (int.TryParse(this.ProxyPortTextBox.Text, out proxyPort))
                {
                    if (this._Settings.ProxyPort <= 0)
                    {
                        this._Settings.ProxyPort = 0;
                    }
                }
                else
                {
                    this._Settings.ProxyPort = 0;
                }
                this._Settings.ProxyUserId = this.ProxyUserIdTextBox.Text;
                this._Settings.ProxyPassword = DPAPI.ProtectData(this.ProxyPasswordTextBox.Text, BloggerBackup.My.Resources.Resources.BlogURL);
            }
            return result;
        }

        private void UseWebProxyCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            if (this.UseWebProxyCheckBox.Checked)
            {
                this.ProxyURLTextBox.Enabled = true;
                this.ProxyPortTextBox.Enabled = true;
                this.ProxyUserIdTextBox.Enabled = true;
                this.ProxyPasswordTextBox.Enabled = true;
            }
            else
            {
                this.ProxyURLTextBox.Enabled = false;
                this.ProxyPortTextBox.Enabled = false;
                this.ProxyUserIdTextBox.Enabled = false;
                this.ProxyPasswordTextBox.Enabled = false;
            }
        }

        internal virtual Button Cancel_Button
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Cancel_Button;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.Cancel_Button_Click);
                if (this._Cancel_Button != null)
                {
                    this._Cancel_Button.Click -= handler;
                }
                this._Cancel_Button = value;
                if (this._Cancel_Button != null)
                {
                    this._Cancel_Button.Click += handler;
                }
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Button OK_Button
        {
            [DebuggerNonUserCode]
            get
            {
                return this._OK_Button;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.OK_Button_Click);
                if (this._OK_Button != null)
                {
                    this._OK_Button.Click -= handler;
                }
                this._OK_Button = value;
                if (this._OK_Button != null)
                {
                    this._OK_Button.Click += handler;
                }
            }
        }

        internal virtual TextBox ProxyPasswordTextBox
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ProxyPasswordTextBox;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ProxyPasswordTextBox = value;
            }
        }

        internal virtual MaskedTextBox ProxyPortTextBox
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ProxyPortTextBox;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ProxyPortTextBox = value;
            }
        }

        internal virtual TextBox ProxyURLTextBox
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ProxyURLTextBox;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ProxyURLTextBox = value;
            }
        }

        internal virtual TextBox ProxyUserIdTextBox
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ProxyUserIdTextBox;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ProxyUserIdTextBox = value;
            }
        }

        internal virtual TableLayoutPanel TableLayoutPanel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TableLayoutPanel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TableLayoutPanel1 = value;
            }
        }

        internal virtual CheckBox UseWebProxyCheckBox
        {
            [DebuggerNonUserCode]
            get
            {
                return this._UseWebProxyCheckBox;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.UseWebProxyCheckBox_CheckedChanged);
                if (this._UseWebProxyCheckBox != null)
                {
                    this._UseWebProxyCheckBox.CheckedChanged -= handler;
                }
                this._UseWebProxyCheckBox = value;
                if (this._UseWebProxyCheckBox != null)
                {
                    this._UseWebProxyCheckBox.CheckedChanged += handler;
                }
            }
        }
    }
}

